using IQIGame.Onigao.Framework;
using IQIGame.Onigao.Game;

namespace IQIGame.Onigao.GamePlay
{
    public class UIN_HeroInfoTab : UIBaseNode
    {

        #region Template Generate,don't modify
        protected partial class UIB_UIN_HeroInfoTab
        {
            #region ObjectBinding Generate
            public IQIGame.Onigao.Framework.ExToggle toggleTab { protected set; get; }
            public IQIGame.Onigao.Framework.ExText eng { protected set; get; }
            public IQIGame.Onigao.Framework.ExText title { protected set; get; }
            public IQIGame.Onigao.Framework.ExText titleOn { protected set; get; }
            public IQIGame.Onigao.Framework.ExArtSpriteNum icon { protected set; get; }
            public IQIGame.Onigao.Framework.ExArtSpriteNum iconOn { protected set; get; }
            public virtual void InitBinding(ObjectBinding __binding)
            {
                __binding.TryGetVariableValue<IQIGame.Onigao.Framework.ExToggle>("toggleTab", out var __tbv0);
                this.toggleTab = __tbv0;
                __binding.TryGetVariableValue<IQIGame.Onigao.Framework.ExText>("eng", out var __tbv1);
                this.eng = __tbv1;
                __binding.TryGetVariableValue<IQIGame.Onigao.Framework.ExText>("title", out var __tbv2);
                this.title = __tbv2;
                __binding.TryGetVariableValue<IQIGame.Onigao.Framework.ExText>("titleOn", out var __tbv3);
                this.titleOn = __tbv3;
                __binding.TryGetVariableValue<IQIGame.Onigao.Framework.ExArtSpriteNum>("icon", out var __tbv4);
                this.icon = __tbv4;
                __binding.TryGetVariableValue<IQIGame.Onigao.Framework.ExArtSpriteNum>("iconOn", out var __tbv5);
                this.iconOn = __tbv5;
            }
            #endregion ObjectBinding Generate 
        }
        #endregion Template Generate,don't modify

        #region fields & properties
        public int tabIndex { get; private set; } = -1;

        protected UIB_UIN_HeroInfoTab ui { get; set; }
        #endregion

        protected override void BeforeInit()
        {
            ui = new UIB_UIN_HeroInfoTab();
            ui.InitBinding(this.csObjBind);
        }

        protected override void OnInit()
        {

        }

        protected override void OnShow()
        {

        }

        protected override void OnHide()
        {

        }

        public void Show(int data)
        {
            this.Show();
            this.tabIndex = data;
            int emInt = this.tabIndex;
            this.ui.title.text = APIUIHeroInfo.GetTabName(emInt);
            this.ui.titleOn.text = APIUIHeroInfo.GetTabName(emInt);
            this.ui.eng.text = APIUIHeroInfo.GetTabEnName(emInt);
            int type = emInt + 1;
            this.ui.icon.SetInt(type);
            this.ui.iconOn.SetInt(type);
        }

        protected override void OnDispose()
        {

        }
    }
}
